home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Technotools
/
Technotools (Chestnut CD-ROM)(1993).ISO
/
lang_c
/
msqc25t1
/
twowins.c
< prev
next >
Wrap
C/C++ Source or Header
|
1990-09-29
|
1KB
|
45 lines
/* twowins.c: Shuttling between two popup windows */
#include <conio.h>
#include <stdio.h>
#include <graph.h>
#include "popup.h"
#include "textscrn.h"
POPUP w[] = {
{ 3, 10, 7, 26, 1, BLACK, 0, CYAN, 0, NULL, 0, 0},
{13, 50, 17, 66, 2, BLACK, 0, GREEN, 0, NULL, 0, 0}
};
main()
{
int n;
/* Save entry screen, open opo-ups */
_savescrn (0);
for (n = 0; n < 2; n++)
popShow (&(w[n]));
/* Write in one window, then other after keypress */
for (n = 0; n < 2; n++) {
popUse (&(w[n])); /* use window n */
_outtextf ("Now in window %d", n); /* write text */
_outtext ("\nPress a key...");
popKeep (&(w[n])); /* save state */
getch();
}
/* Return to successive windows on further keypresses */
for (n = 0; n < 2; n++) {
popUse (&(w[n])); /* use window n */
_outtextf ("\n\nBack in window %d", n);
_outtext ("\nPress a key...");
getch(); /* wait */
}
/* Remove windows from screen and quit */
_restscrn (0);
}